/**
 * Created by qian.zhou on 2017/2/23.
 */

var React = require('react');

module.exports = React.createClass({
    getInitialState:function(){
        return {
            img:''

        }
    },
    componentDidMount:function(){
        if(this.props.img){
            this.setState({img:this.props.img});
        }
    },
    renwuInfo(){
        var photo_xq = this.props.data;
        console.log(photo_xq);
        localStorage.setItem("renwuInfo",photo_xq);
        localStorage.setItem("goods_id",this.props.goods_id);
        location.href = "#renwuInfo";
    },
    render:function(){
        return (
            <div className="product-img" onClick={this.renwuInfo}>
                <img src={this.state.img} />
            </div>
        )
    }
});